package judesart.app.client;

import judesart.app.client.pub.layout.ui.PublicMainLayout;

import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.GXT;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.ui.RootPanel;

public class PublicApp implements EntryPoint {
    /**
     */
    public void onModuleLoad() {
        Log.setUncaughtExceptionHandler();

        DeferredCommand.addCommand(new Command() {
            @Override
            public void execute() {
                onModuleLoad2();
            }
        });
    }

    /**
     * This is the entry point method.
     * 
     * @wbp.parser.entryPoint
     */
    public void onModuleLoad2() {
        PublicMainLayout mainPanel = PublicMainLayout.getInstance();
        // mainPanel.setStyleAttribute("margin", "0 auto");
        // mainPanel.setStyleAttribute("overflow", "auto");
        // mainPanel.setWidth(960);
        mainPanel.setHeight("100%");
        if (GXT.isChrome)
            mainPanel.addStyleName("chrome");
        else if (GXT.isIE)
            mainPanel.addStyleName("ie");

        RootPanel.get().add(mainPanel);
        mainPanel.layout();
    }
}
